fs: Use safe math macros to prevent overflows
authorLidong Chen <lidong.chen@oracle.com>
Tue, 21 Jan 2025 19:02:36 +0000 (19:02 +0000)
committerFelix Zielcke <fzielcke@z-51.de>
Thu, 3 Jul 2025 16:35:51 +0000 (18:35 +0200)
commit674f3c8b1571c0a3d85ac51685b3d4487e4ed83a
tree15147d7d7ac6aafc255ed00b3826a66938d0c5fe
parent3820e4d435a044ad122fe7e0ad6ef14342c1dfd2
fs: Use safe math macros to prevent overflows

Replace direct arithmetic operations with macros from include/grub/safemath.h
to prevent potential overflow issues when calculating the memory sizes.

Signed-off-by: Lidong Chen <lidong.chen@oracle.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Conflicts:
grub-core/fs/erofs.c

Gbp-Pq: Topic cve-2025-jan
Gbp-Pq: Name fs-Use-safe-math-macros-to-prevent-overflows.patch
grub-core/fs/archelp.c
grub-core/fs/btrfs.c
grub-core/fs/cpio_common.c
grub-core/fs/f2fs.c
grub-core/fs/ntfscomp.c
grub-core/fs/squash4.c
grub-core/fs/xfs.c